import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {
  OtherOutWarehouseOrder1VO,
  OtherOutWarehouseOrder1Form,
  OtherOutWarehouseOrder1Query
} from '@/api/jdAndJstSceneClassification/deptGetMaterial/otherOutWarehouseOrder1/types';

/**
 * 查询金蝶-其他出库单列表
 * @param query
 * @returns {*}
 */
export const listOtherOutWarehouseOrder1 = (query?: OtherOutWarehouseOrder1Query): AxiosPromise<OtherOutWarehouseOrder1VO[]> => {
  return request({
    url: '/dataCheck/jd/otherOutWarehouseOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询金蝶-其他出库单列表
 * 01、定义后端接口
 * @param query
 * @returns {*}
 */
export const listOtherOutWarehouseOrder1ByCustomer1 = (query?: OtherOutWarehouseOrder1Query): AxiosPromise<OtherOutWarehouseOrder1VO[]> => {
  return request({
    url: '/dataCheck/jd/otherOutWarehouseOrder/list-by-customer1',
    method: 'get',
    params: query
  });
};

/**
 * 查询金蝶-其他出库单详细
 * @param id
 */
export const getOtherOutWarehouseOrder1 = (id: string | number): AxiosPromise<OtherOutWarehouseOrder1VO> => {
  return request({
    url: '/dataCheck/jd/otherOutWarehouseOrder/' + id,
    method: 'get'
  });
};

/**
 * 新增金蝶-其他出库单
 * @param data
 */
export const addOtherOutWarehouseOrder1 = (data: OtherOutWarehouseOrder1Form) => {
  return request({
    url: '/dataCheck/jd/otherOutWarehouseOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改金蝶-其他出库单
 * @param data
 */
export const updateOtherOutWarehouseOrder1 = (data: OtherOutWarehouseOrder1Form) => {
  return request({
    url: '/dataCheck/jd/otherOutWarehouseOrder',
    method: 'put',
    data: data
  });
};

/**
 * 删除金蝶-其他出库单
 * @param id
 */
export const delOtherOutWarehouseOrder1 = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dataCheck/jd/otherOutWarehouseOrder/' + id,
    method: 'delete'
  });
};
